﻿using FluentValidation;

namespace ED.Common.Utils
{
    public class ModelValidatorHelp<T> where T : class
    {
        public static void Valid(AbstractValidator<T> validation, T req)
        {
          var checkRes = validation.Validate(req);
            if (!checkRes.IsValid) 
            {
                ThrowHelp.Throw(checkRes.Errors.FirstOrDefault().ErrorMessage);
            }
        }
    }
}
